<#assign title="导航菜单添加页面">
<#include "/admin/inc/top.html"/>
<div class="main-content" id="main-content">
    <header class="header navbar bg-white shadow">
        <div class="btn-group tool-button">
            <a class="btn btn-primary navbar-btn" href="${base!}/private/fof/sysMenu" data-pjax><i
                    class="fa fa-reply"></i> 返回</a>
        </div>
    </header>
    <section class="content">

        <div class="form-wrapper" style="min-height:500px;">
            <section class="panel panel-form">
                <form id="unitAddForm" role="form" class="form-horizontal parsley-form" data-parsley-validate
                      action="${base!}/private/fof/sysMenu/addDo" method="post">
                    <div class="row mb10">
                        <div class="col-lg-12">
                            <div class="form-group">
                                <label for="parentName" class="col-sm-2 control-label">父级名称</label>

                                <div class="col-sm-8">
                                    <input type="hidden" id="parentId" name="parentId">
                                    <input disabled type="text" id="parentName" class="form-control" name="parentName"
                                           placeholder="父级名称">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label for="name" class="col-sm-2 control-label">菜单名称</label>

                                <div class="col-sm-8">
                                    <input type="text" id="name" class="form-control" name="name"
                                           placeholder="菜单名称">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label for="aliasName" class="col-sm-2 control-label">菜单别名</label>

                                <div class="col-sm-8">
                                    <input type="text" id="aliasName" class="form-control" name="aliasName"
                                           placeholder="菜单别名">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">资源类型</label>

                                <div class="col-sm-8">
                                    <input class="ichk" id="dataType" type="radio" name="type" value="1"> <label for="dataType">数据</label>
                                    <input class="ichk" id="menuType" type="radio" name="type" value="1"> <label for="menuType">菜单</label>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label for="href" class="col-sm-2 control-label">菜单链接</label>

                                <div class="col-sm-8">
                                    <input type="text" id="href" class="form-control" name="href"
                                           placeholder="菜单链接">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label for="target" class="col-sm-2 control-label">打开方式</label>

                                <div class="col-sm-8">
                                    <select class="input-medium form-control" id="target" name="target">
                                        <option value="data-pjax">pjax方式</option>
                                        <option value="blank">外部页面</option>
                                    </select>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label for="icon" class="col-sm-2 control-label">菜单图标</label>

                                <div class="col-sm-8">
                                    <input type="text" id="icon" class="form-control" name="icon"
                                           placeholder="菜单图标">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">是否显示</label>

                                <div class="col-sm-8">
                                    <input class="ichk" id="notShow" type="radio" name="isShow" value="0"> <label for="notShow">隐藏</label>
                                    <input class="ichk" id="show" type="radio" name="isShow" value="1"> <label for="show">显示</label>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">是否禁用</label>

                                <div class="col-sm-8">
                                    <input class="ichk" id="disabled1" type="radio" name="disabled" value="0"> <label for="disabled1">禁用</label>
                                    <input class="ichk" id="disabled2" type="radio" name="disabled" value="1"> <label for="disabled2">正常</label>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>
                    </div>
                    <div class="col-lg-3"></div>
                    <div class="col-lg-6">
                        <div class="form-group text-center">
                            <label></label>

                            <div>
                                <button class="btn btn-primary btn-block btn-lg btn-parsley"
                                        data-loading-text="正在提交...">提 交
                                </button>
                            </div>
                        </div>
                    </div>
                </form>
            </section>

        </div>
        <a class="exit-offscreen"></a>
    </section>
</div>
<script language="JavaScript">
    $(document).ready(function () {
        $('#unitAddForm').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, form, options) {
                form.find("button:submit").button("loading");
            },
            success: function (data, statusText, xhr, form) {
                if (data.code == 200) {
                    Toast.success(data.msg);
                    form.resetForm();
                } else {
                    Toast.error(data.msg);
                }
                form.find("button:submit").button("reset");
            }
        });
    });
</script>
<#include "/admin/inc/bottom.html"/>